package com.drop.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Childorder entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "childorder", catalog = "feature_mall")
public class Childorder implements java.io.Serializable {

	// Fields

	private Integer childOrderId;
	private Goods goods;
	private Order order;
	private Float money;
	private Integer quantity;

	// Constructors

	/** default constructor */
	public Childorder() {
	}

	/** full constructor */
	public Childorder(Goods goods, Order order, Float money, Integer quantity) {
		this.goods = goods;
		this.order = order;
		this.money = money;
		this.quantity = quantity;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "childOrderId", unique = true, nullable = false)
	public Integer getChildOrderId() {
		return this.childOrderId;
	}

	public void setChildOrderId(Integer childOrderId) {
		this.childOrderId = childOrderId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "goodsId")
	public Goods getGoods() {
		return this.goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "orderId")
	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	@Column(name = "money", precision = 12, scale = 0)
	public Float getMoney() {
		return this.money;
	}

	public void setMoney(Float money) {
		this.money = money;
	}

	@Column(name = "quantity")
	public Integer getQuantity() {
		return this.quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

}